package com.zshan.clinic.database.model;

import java.io.Serializable;
import java.time.LocalDate;
import java.util.Date;

/**
 * 库存表
 */
public class StockDrug implements Serializable {
    /** 库存ID */
    private Long stockId;

    /** 药品ID */
    private Long drugId;

    /** 库房ID */
    private Long storageId;

    /** 库存数量 */
    private Integer stockQty;

    /** 库存单位 */
    private String stockUnit;

    /** 最小库存数量 */
    private Integer minStockQty;

    /** 最小库存单位 */
    private String minStockUnit;

    /** 最近有效期 */
    private LocalDate nearestExpiryDate;

    /** 乐观锁 */
    private Integer version;

    /** 启用状态 */
    private String isEnabled;

    /** 删除标识 */
    private String isDelete;

    /** 诊所ID */
    private Long clinicId;

    private Long createUserId;

    /** 创建人 */
    private String createBy;

    /** 创建时间 */
    private Date createTime;

    private Long updateUserId;

    /** 更新人 */
    private String updateBy;

    /** 更新时间 */
    private Date updateTime;

    private static final long serialVersionUID = 1L;

    public Long getStockId() {
        return stockId;
    }

    public void setStockId(Long stockId) {
        this.stockId = stockId;
    }

    public Long getDrugId() {
        return drugId;
    }

    public void setDrugId(Long drugId) {
        this.drugId = drugId;
    }

    public Long getStorageId() {
        return storageId;
    }

    public void setStorageId(Long storageId) {
        this.storageId = storageId;
    }

    public Integer getStockQty() {
        return stockQty;
    }

    public void setStockQty(Integer stockQty) {
        this.stockQty = stockQty;
    }

    public String getStockUnit() {
        return stockUnit;
    }

    public void setStockUnit(String stockUnit) {
        this.stockUnit = stockUnit == null ? null : stockUnit.trim();
    }

    public Integer getMinStockQty() {
        return minStockQty;
    }

    public void setMinStockQty(Integer minStockQty) {
        this.minStockQty = minStockQty;
    }

    public String getMinStockUnit() {
        return minStockUnit;
    }

    public void setMinStockUnit(String minStockUnit) {
        this.minStockUnit = minStockUnit == null ? null : minStockUnit.trim();
    }

    public LocalDate getNearestExpiryDate() {
        return nearestExpiryDate;
    }

    public void setNearestExpiryDate(LocalDate nearestExpiryDate) {
        this.nearestExpiryDate = nearestExpiryDate;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    public String getIsEnabled() {
        return isEnabled;
    }

    public void setIsEnabled(String isEnabled) {
        this.isEnabled = isEnabled == null ? null : isEnabled.trim();
    }

    public String getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(String isDelete) {
        this.isDelete = isDelete == null ? null : isDelete.trim();
    }

    public Long getClinicId() {
        return clinicId;
    }

    public void setClinicId(Long clinicId) {
        this.clinicId = clinicId;
    }

    public Long getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(Long createUserId) {
        this.createUserId = createUserId;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy == null ? null : createBy.trim();
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Long getUpdateUserId() {
        return updateUserId;
    }

    public void setUpdateUserId(Long updateUserId) {
        this.updateUserId = updateUserId;
    }

    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy == null ? null : updateBy.trim();
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        StockDrug other = (StockDrug) that;
        return (this.getStockId() == null ? other.getStockId() == null : this.getStockId().equals(other.getStockId()))
            && (this.getDrugId() == null ? other.getDrugId() == null : this.getDrugId().equals(other.getDrugId()))
            && (this.getStorageId() == null ? other.getStorageId() == null : this.getStorageId().equals(other.getStorageId()))
            && (this.getStockQty() == null ? other.getStockQty() == null : this.getStockQty().equals(other.getStockQty()))
            && (this.getStockUnit() == null ? other.getStockUnit() == null : this.getStockUnit().equals(other.getStockUnit()))
            && (this.getMinStockQty() == null ? other.getMinStockQty() == null : this.getMinStockQty().equals(other.getMinStockQty()))
            && (this.getMinStockUnit() == null ? other.getMinStockUnit() == null : this.getMinStockUnit().equals(other.getMinStockUnit()))
            && (this.getNearestExpiryDate() == null ? other.getNearestExpiryDate() == null : this.getNearestExpiryDate().equals(other.getNearestExpiryDate()))
            && (this.getVersion() == null ? other.getVersion() == null : this.getVersion().equals(other.getVersion()))
            && (this.getIsEnabled() == null ? other.getIsEnabled() == null : this.getIsEnabled().equals(other.getIsEnabled()))
            && (this.getIsDelete() == null ? other.getIsDelete() == null : this.getIsDelete().equals(other.getIsDelete()))
            && (this.getClinicId() == null ? other.getClinicId() == null : this.getClinicId().equals(other.getClinicId()))
            && (this.getCreateUserId() == null ? other.getCreateUserId() == null : this.getCreateUserId().equals(other.getCreateUserId()))
            && (this.getCreateBy() == null ? other.getCreateBy() == null : this.getCreateBy().equals(other.getCreateBy()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateUserId() == null ? other.getUpdateUserId() == null : this.getUpdateUserId().equals(other.getUpdateUserId()))
            && (this.getUpdateBy() == null ? other.getUpdateBy() == null : this.getUpdateBy().equals(other.getUpdateBy()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getStockId() == null) ? 0 : getStockId().hashCode());
        result = prime * result + ((getDrugId() == null) ? 0 : getDrugId().hashCode());
        result = prime * result + ((getStorageId() == null) ? 0 : getStorageId().hashCode());
        result = prime * result + ((getStockQty() == null) ? 0 : getStockQty().hashCode());
        result = prime * result + ((getStockUnit() == null) ? 0 : getStockUnit().hashCode());
        result = prime * result + ((getMinStockQty() == null) ? 0 : getMinStockQty().hashCode());
        result = prime * result + ((getMinStockUnit() == null) ? 0 : getMinStockUnit().hashCode());
        result = prime * result + ((getNearestExpiryDate() == null) ? 0 : getNearestExpiryDate().hashCode());
        result = prime * result + ((getVersion() == null) ? 0 : getVersion().hashCode());
        result = prime * result + ((getIsEnabled() == null) ? 0 : getIsEnabled().hashCode());
        result = prime * result + ((getIsDelete() == null) ? 0 : getIsDelete().hashCode());
        result = prime * result + ((getClinicId() == null) ? 0 : getClinicId().hashCode());
        result = prime * result + ((getCreateUserId() == null) ? 0 : getCreateUserId().hashCode());
        result = prime * result + ((getCreateBy() == null) ? 0 : getCreateBy().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateUserId() == null) ? 0 : getUpdateUserId().hashCode());
        result = prime * result + ((getUpdateBy() == null) ? 0 : getUpdateBy().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", stockId=").append(stockId);
        sb.append(", drugId=").append(drugId);
        sb.append(", storageId=").append(storageId);
        sb.append(", stockQty=").append(stockQty);
        sb.append(", stockUnit=").append(stockUnit);
        sb.append(", minStockQty=").append(minStockQty);
        sb.append(", minStockUnit=").append(minStockUnit);
        sb.append(", nearestExpiryDate=").append(nearestExpiryDate);
        sb.append(", version=").append(version);
        sb.append(", isEnabled=").append(isEnabled);
        sb.append(", isDelete=").append(isDelete);
        sb.append(", clinicId=").append(clinicId);
        sb.append(", createUserId=").append(createUserId);
        sb.append(", createBy=").append(createBy);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateUserId=").append(updateUserId);
        sb.append(", updateBy=").append(updateBy);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}